function ctrP = InvCtrP(InputsStruct)
    data = InputsStruct.data;
    dataPara = InputsStruct.dataPara;
    knots = InputsStruct.knots;
    k = InputsStruct.k;
    ctrPnums = InputsStruct.ctrPnums;
    m = size(data,1);
    %计算r矩阵
    r = zeros(ctrPnums-2,2);
    for i = 2:(m-1)
        r(i-1,:) = data(i,:)-data(1,:).*GetBasisFcn(dataPara(i),knots,0,k)...
                -data(m,:).*GetBasisFcn(dataPara(i),knots,ctrPnums-1,k);
    end
    %计算N矩阵
    N = zeros(m-2,ctrPnums-2);
    for j = 2:(m-1)
        x = zeros(1,ctrPnums-2);
        for i = 2:(ctrPnums-1)
            x(i-1) = GetBasisFcn(dataPara(j),knots,i-1,k);
        end
        N(j-1,:) = x;
    end
    R = N'*r;
    ctrP = [data(1,:);(N'*N)\R; data(m,:)];
end